<?php
	require_once("../classes/Post.php");
	require_once("../classes/User.php");
	
	session_start();
	
	$user = $_SESSION["user"];
	$ad = $_POST["ad"];
	
	$post = new Post();
	
	$post->setValues($ad, $user->getId(), $_POST["post"]);
	
	$post->save();
	
	header("Location: ../announcement.php?ad=".$ad);
?>